import request from '@/utils/request'

const modelName = 'system-user'

// 全部的用户信息
export const allUsers = (offset, pageSize, roleId) => {
  return request({
    url: modelName + '/intelligence-user/user/manager/allUsers',
    method: 'get',
    params: {
      offset: offset,
      pageSize: pageSize,
      roleId: roleId,
    },
  })
}
// 用户禁用
export const disable = data => {
  return request({
    url: modelName + '/intelligence-user/user/manager/disable/' + data,
    method: 'get',
  })
}
// 用户角色列表
export const roleList = () => {
  return request({
    url: modelName + '/intelligence-user/user/manager/roleList',
    method: 'get',
  })
}

// 新增用户
export const addUser = data => {
  return request({
    url: modelName + '/intelligence-user/user/manager/addUser',
    method: 'post',
    data,
  })
}

//角色的菜单列表
export const findSysRolePermissionByRoleId = data => {
  return request({
    url:
      modelName +
      '/intelligence-user/role/findSysRolePermissionByRoleId/' +
      data,
    method: 'get',
  })
}

//角色新的菜单权限
export const saveNewMenuFromRole = data => {
  return request({
    url: modelName + '/intelligence-user/role/saveNewMenuFromRole',
    method: 'post',
    data,
  })
}
